package Demo2;

//泛型上界
public class MyArray<T extends Number>{
    public Object[] objects = new Object[10];

    public void setArray(int pos,T source){
        objects[pos] = source;
    }

    public T getArray(int pos){
        return (T) objects[pos];
    }
}
